﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using UI.Desktop.HorarioLaboral;

namespace UI.Desktop
{
    public partial class frmHorario : Form
    {
        public frmHorario()
        {
            InitializeComponent();
        }

        
        private void btnCerrarHorario_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void cbHorarioLaboral_Click(object sender, EventArgs e)
        {
            Business.Entities.HorarioLaboral HL = new Business.Entities.HorarioLaboral();
            DataSet dsHor = new DataSet();
            dsHor = HL.ObtenerListaHorarioLaboral();
            ObtenerHorarioLaboral(dsHor);
        }

        private void ObtenerHorarioLaboral(DataSet dsHor)
        {
            cbHorarioLaboral.Text = "Seleccione el Horario";
            cbHorarioLaboral.DataSource = dsHor.Tables["HorarioLaboral"];
            cbHorarioLaboral.DisplayMember = dsHor.Tables["HorarioLaboral"].Columns[0].Caption.ToString();
        }

        private void btnAgregarCiudad_Click(object sender, EventArgs e)
        {
            frmAgregarHorarioLaboral AHL = new frmAgregarHorarioLaboral();
            AHL.Show();
        }

        private void cbElemento_Click(object sender, EventArgs e)
        {
            Business.Entities.HorarioLaboral HL = new Business.Entities.HorarioLaboral();
            DataSet dsHor = new DataSet();
            dsHor = HL.ObtenerListaHorarioLaboral();
            ObtenerElemento(dsHor);

        }



        private void ObtenerElemento(DataSet dsHor)
        {
            cbHorarioLaboral.Text = "Seleccione el Horario";
            cbHorarioLaboral.DataSource = dsHor.Tables["HorarioLaboral"];
            cbHorarioLaboral.DisplayMember = dsHor.Tables["HorarioLaboral"].Columns[0].Caption.ToString();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            frmAltaElemento AE = new frmAltaElemento();
            AE.Show();
        }
    
    
    
    
    
    }
}
